package service;

import dao.GoodsDao;
import model.Goods;

import java.util.List;
import java.util.Map;

public class GoodsService {
    private GoodsDao gDao = new GoodsDao();
    public List<Map<String,Object>> getScrollGood() {
        List<Map<String,Object>> list = null;
        try {
            list = gDao.getScrollGood();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }

    public List<Map<String,Object>> getGoodsList(int recommendType) {
        List<Map<String,Object>> list = null;
        try {
            list = gDao.getGoodsList(recommendType);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }

    public Goods getGoodsById(int id) {
        Goods g = null;
        try {
            g = gDao.getGoodsById(id);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return g;
    }
}
